package com.zline.foodraise.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by heshantao on 15/8/10.
 * JS 端获得的传递给订单评论的实例
 */
public class JsOrderCommentBean implements Parcelable {
    //订单编号
    long orderId;
    //类型
    int type;
    //资源ID
    long resourceId;
    //商品的名称
    String productName;
    //商品主图的图片地址
    String productMainPicUrl;
    //购买数量
    int orderCount;
    //商品单价
    double price;

    public JsOrderCommentBean() {
    }

    public JsOrderCommentBean(int orderCount, long orderId, double price,
                              String productMainPicUrl, String productName,
                              long resourceId, int type) {
        this.orderCount = orderCount;
        this.orderId = orderId;
        this.price = price;
        this.productMainPicUrl = productMainPicUrl;
        this.productName = productName;
        this.resourceId = resourceId;
        this.type = type;
    }

    public int getOrderCount() {
        return orderCount;
    }

    public void setOrderCount(int orderCount) {
        this.orderCount = orderCount;
    }

    public long getOrderId() {
        return orderId;
    }

    public void setOrderId(long orderId) {
        this.orderId = orderId;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getProductMainPicUrl() {
        return productMainPicUrl;
    }

    public void setProductMainPicUrl(String productMainPicUrl) {
        this.productMainPicUrl = productMainPicUrl;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public long getResourceId() {
        return resourceId;
    }

    public void setResourceId(long resourceId) {
        this.resourceId = resourceId;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(orderId);
        dest.writeInt(type);
        dest.writeLong(resourceId);
        dest.writeString(productName);
        dest.writeString(productMainPicUrl);
        dest.writeInt(orderCount);
        dest.writeDouble(price);

    }


    public static final Creator<JsOrderCommentBean> CREATOR = new Creator<JsOrderCommentBean>() {
        public JsOrderCommentBean createFromParcel(Parcel in) {
            return new JsOrderCommentBean(in);
        }

        public JsOrderCommentBean[] newArray(int size) {
            return new JsOrderCommentBean[size];
        }
    };


    private JsOrderCommentBean(Parcel in) {
        orderId = in.readLong();
        type = in.readInt();
        resourceId = in.readLong();
        productName = in.readString();
        productMainPicUrl = in.readString();
        orderCount = in.readInt();
        price = in.readDouble();
    }
}
